<template>
  <div class="home-skeleton">
    <div
      class="item"
      v-for="i in length"
      :key="i"
      :style="{ backgroundColor: bg }"
    >
      <xtx-skeleton bg="#e4e4e4" width="306px" height="406px" animated />
      <xtx-skeleton bg="#e4e4e4" width="160px" height="24px" animated />
      <xtx-skeleton bg="#e4e4e4" width="120px" height="24px" animated />
    </div>
  </div>
</template>

<script setup name:home-skeleton>
import { defineProps } from "vue";

defineProps({
  bg: {
    type: String,
    default: "#fff"
  },
  length: {
    type: Number,
    default: 4
  }
});
</script>

<style lang="less" scoped>
.home-skeleton {
  width: 1240px;
  height: 406px;
  display: flex;
  justify-content: space-between;
  .item {
    width: 306px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .xtx-skeleton~.xtx-skeleton{
    //   display: block;
      margin: 16px auto 0;
    }
  }
}
</style>
